import java.util.*;

public class ArrayDequeWithLinkedList  {
	public static void main(String[] args) {
		Deque<Integer> q1 = new ArrayDeque<>();
		Deque<Integer> q2 = new LinkedList<>();

		q1.offer(1);
		// q1.offer(null); // 空指针异常
		System.out.println(q1.size());
		System.out.println("------------");

		q2.offer(2);
		q2.offer(null);
		q2.offer(null);
		System.out.println(q2.size());
		while (!q2.isEmpty()) {
			Integer temp = q2.poll();
			System.out.println(temp);
		}
	}
}
